//
//  CZQAddEducationExperView.m
//  coachmanage
//
//  Created by 众拳科技 on 2018/3/14.
//  Copyright © 2018年 众拳科技. All rights reserved.
//

#import "CZQAddEducationExperView.h"

@implementation CZQAddEducationExperView
-(id)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        UIScrollView *scrollView = [[UIScrollView alloc] init];
        [self addSubview:scrollView];
        self.scrollView = scrollView;
        
        
        
        /**
         学校名称
         */
        CommonInputView *companyInputView = [[CommonInputView alloc] init];
        companyInputView.titleLabel.text = @"学校名称*";
        companyInputView.titleTF.placeholder = @"学校名称";
        [scrollView addSubview:companyInputView];
        self.schoolNameView = companyInputView;
        
        /**
         专业
         */
        CommonInputView *jobNameInputView = [[CommonInputView alloc] init];
        jobNameInputView.titleLabel.text = @"专业*";
        jobNameInputView.titleTF.placeholder = @"专业";
        [scrollView addSubview:jobNameInputView];
        self.majorView = jobNameInputView;
        
        
        
        /**
         入校时间
         */
        CommonBtnView *startBtnView = [[CommonBtnView alloc] init];
        startBtnView.titleLabel.text = @"入校时间*";
        startBtnView.choseLabel.text = @"选择入校时间";
        startBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:startBtnView];
        self.startTimeBtnView = startBtnView;
        
        /**
         毕业时间
         */
        CommonBtnView *endBtnView = [[CommonBtnView alloc] init];
        endBtnView.titleLabel.text = @"毕业时间*";
        endBtnView.choseLabel.text = @"选择毕业时间";
        endBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:endBtnView];
        self.endTimeBtnView = endBtnView;
        
        /**
         学位
         */
        CommonBtnView *deBtnView = [[CommonBtnView alloc] init];
        deBtnView.titleLabel.text = @"学位*";
        deBtnView.choseLabel.text = @"选择学位";
        deBtnView.choseLabel.textColor = PlaceHoldColor;
        [scrollView addSubview:deBtnView];
        self.degreeBtnView = deBtnView;
        
        
        
        [self setConstraints];
    }
    
    return self;
}

-(void)setConstraints{
    
    [self.scrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.mas_equalTo(self);
    }];
    
    
    //学校名称
    [self.schoolNameView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //专业
    [self.majorView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.schoolNameView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //起始时间
    [self.startTimeBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.majorView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //结束时间
    [self.endTimeBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.startTimeBtnView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    //学位
    [self.degreeBtnView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.endTimeBtnView.mas_bottom);
        
        make.left.width.mas_equalTo(self);
    }];
    
    
    
    
}

-(void)layoutSubviews{
    
    self.scrollView.contentSize = CGSizeMake(self.width, self.degreeBtnView.bottom + CZQ_StatusBarHeight + CZQ_NavigationBarHeight);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
